//
//  GLCollectionViewCellForRecommend.m
//  ttpod
//
//  Created by apple on 16/3/21.
//  Copyright © 2016年 Scott. All rights reserved.
//

#import "GLCollectionViewCellForRecommend.h"
#import "NetworkHander.h"
#import "YPModelForRecommend.h"
#import "HJCarouselViewLayout.h"




@interface GLCollectionViewCellForRecommend () <NetworkHandlerDelegate>

@property (nonatomic, retain) NSMutableArray *arrForData; // 数据数组.

@property (nonatomic, retain) UICollectionView *collectionViewForScroll;

@property (nonatomic, retain) HJCarouselViewLayout *layoutForCollent;

@end

@implementation GLCollectionViewCellForRecommend

- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        [self handleData];
        
        /** 轮播图 */
        
        
    }
    return self;
}



- (void)handleData {
    
    
    NSString *str = @"http://api.dongting.com/frontpage/frontpage?uid=0&f=f62&v=v8.4.0.2016022715&utdid=VK4nCDeiX9UDAL%2B8TvJRNjEl&net=2&s=s200&location=1";
    
    [NetworkHander handlerJSONWithURL:str delegate:self];
}

- (void)handlerDidComplete:(id)result {
    
    self.arrForData = [NSMutableArray array];
    
    NSArray *arr = [result objectForKey:@"data"];
    
    for (NSDictionary *dic in arr) {
        
        YPModelForRecommend *model = [[YPModelForRecommend alloc] init];
        
        [model setValuesForKeysWithDictionary:dic];
        
        [self.arrForData addObject:model];
        
    }
}

- (void) createScroll {
    
    HJCarouselViewLayout *layout = nil;
    
    layout = [[HJCarouselViewLayout alloc] initWithAnim:HJCarouselAnimCarousel];
    
    
    layout.itemSize = CGSizeMake(250, 250);
    
}

@end
